<script>
	export default {
		onLaunch: function() {
			uni.login({
			  provider: 'weixin',
			  success: function (loginRes) {
			    const {code}=loginRes
					uni.setStorageSync('code',code)
					uni.request({
						url: 'https://api.weixin.qq.com/sns/jscode2session',
						method: 'GET',
						data: {
							appid:'wxee4db3ec9c618898',
							secret:'6710e51ccc8b965fbe2665192459dd81',
							js_code:code,
							grant_type:'authorization_code'
						},
						success: res => {
							uni.setStorageSync('session_key',res.data.session_key)
						}
					});
			  }
			});
		},
		onShow: function() {
		},
		onHide: function() {
		}
	}
</script>

<style>
	/*每个页面公共css */
</style>
